#pragma once
#include "DataStructDef.h"
#include "afxcmn.h"

// CDeatilStackDlg dialog

class CDeatilStackDlg;
class IDetailStackDlgEvent
{
public:
	virtual BOOL	DetailStackDlgEvent_OnChangeView(CDeatilStackDlg* pDlg,
		CStringA strModuleName, BOOL bCaller) = 0;
};

class CDeatilStackDlg : public CDialog
{
	DECLARE_DYNAMIC(CDeatilStackDlg)

public:
	CDeatilStackDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDeatilStackDlg();

// Dialog Data
	enum { IDD = IDD_DETAILSTACK };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();

	DECLARE_MESSAGE_MAP()

public:
	afx_msg void	OnSize(UINT nType, int cx, int cy);

public:
	void	SetEventHandle(IDetailStackDlgEvent* pEventHandler);
	void	SetRootOfDictTree(CStringA strModuleName, PTreeNode pRoot);

private:
	void	BuildTree();
	void	BuildSubTree(PTreeNode pNode, HTREEITEM hParent);

private:
	CStringA		m_strModuleName;
	PTreeNode		m_pRootDictTree;
	CTreeCtrl		m_oTreeCtrl;
	RECT			m_stListMargin;

	IDetailStackDlgEvent*	m_pEventHandler;
};
